<?php
declare (strict_types=1);

namespace app\user\model\user;

use app\common\model\BaseModel;

/**
 * 定义用户余额模型
 */
class Vip extends BaseModel
{
    /**
     * 表名
     *
     * @var string
     */
    protected $name = 'vip_config';

    /**
     * 设置自动写入时间
     *
     * @var boolean
     */
    protected $autoWriteTimestamp = true;
    protected $createTime = false;

    /**
     * 定义字段类型
     *
     * @var array
     */
    protected $type = [
        'id'          => 'integer',
        'days'        => 'integer',
        'update_time' => 'integer',
    ];

    /**
     * 定义表主键
     *
     * @var string
     */
    protected $pk = 'id';

    protected $globalScope = ['mhm'];

    public function scopeMhm($query)
    {
        $query->where('mhm_id', request()->mhm_id);
    }

}
